// Copyright (C) ZHENG Zhong <heavyzheng nospam-at gmail D0T com>
//
// $Id: comment.cpp 209 2008-08-28 10:05:39Z heavyzheng $
//

#ifndef ZZHENG_XML_SOURCE
#define ZZHENG_XML_SOURCE
#endif // ZZHENG_XML_SOURCE

#include <zzheng/xml/dom/libxml2/comment.hpp>
#include <zzheng/xml/dom/libxml2/utility.hpp>

#include <libxml/tree.h>
#include <cassert>
#include <string>

namespace zzheng {
namespace xml {
namespace dom {
namespace libxml2_ {

    comment::comment(xmlNode* px): child_node(px) {
        assert(raw()->type == XML_COMMENT_NODE);
    }

    comment::~comment() {
        // Do nothing.
    }

    std::string comment::value() const {
        return content();
    }

    void comment::set_value(const std::string& value) {
        set_content(value);
    }

    comment* comment::clone(bool recursive) const {
        xmlNode* px = clone_raw(recursive);
        return static_cast<comment*>(px->_private);
    }

} // namespace zzheng::xml::dom::libxml2_
} // namespace zzheng::xml::dom
} // namespace zzheng::xml
} // namespace zzheng



